I'm not a big fan of triggers (in any application, not just DOORS), but I think that is the only way to implement the following: |
Re: Trigger to restrict changing object based on attribute value Regards, Peter |
Re: Trigger to restrict changing object based on attribute value But perhaps you are trying to use a group to DENY access; that is: folks in group A cannot write to the object, even when they belong to another group that can. The trigger would be a pre-save-attribute trigger. It gets the object about to be modified, and if that object's Customer attr-value, and if its 'b' then it opens group A's definition to find if the current user is therein. Problem is, typical folks cannot see the groups nor the group's memberships, so they cannot make use of a trigger that does. If I were doing this, I'd probably write my own on-demand script to manage 'Deny Access Rights' groups. It would have its own interface and its own 'groups', where each such group is implemented as user-defined User 'attributes' or properties; where the confusing documentation is part of the 'Group and user management' section, look for 'user properties' or 'user defined properties'. The trigger, then would check the attr value and if set, would check to see if the current user was a member of the group associated with that attribute. If so, it would deny the pre-trigger via 'set(trigPreConFail)' with a message, and the attribute wouldn't save.
|